package moltencore.network.game.strategy;

import moltencore.network.protocol.*;
import moltencore.game.Game;
import spark.network.protocol.Response;
import spark.network.strategy.IProtocolHandleStrategy;
import spark.network.protocol.Base;
import spark.network.protocol.Acknowledgement;
import spark.utility.OutWrapper;

import java.util.Collection;

public class CannonFireStrategy implements IProtocolHandleStrategy<CannonFire> {
	private Game game;

	public CannonFireStrategy(Game game) {
		this.game = game;
	}

	@Override
	public void handle(CannonFire packet, OutWrapper<Response> acknowledgement, Collection<Base> additionalData) {
		game.playerFire(packet.getSession());
		acknowledgement.value = new Acknowledgement(packet);
	}
}